package com.xbf.entity;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

@AllArgsConstructor
@NoArgsConstructor
@Data
@TableName("`orders`")
public class Order {

    private static final long serialVersionUID = 1L;

    @TableId(value = "o_id", type = IdType.AUTO)
    @JsonProperty("oId")
    private Integer oId;  //订单id

    @JsonProperty("uId")
    private Integer uId;  //用户id

    @JsonProperty("gId")
    private Integer gId;  //商品id

    @TableField(exist = false)  // 添加此注解
    @JsonProperty("gName")
    private String gName;  //商品名称

    @JsonProperty("oNum")
    private Integer oNum; //购买数量

    @TableField(exist = false)  // 添加此注解
    @JsonProperty("gPrice")
    private Double gPrice; //商品价格

    @JsonProperty("oPrice")
    private Double oPrice; //总价

    @JsonProperty("oTime")
    private Date oTime; //订单时间

    @JsonProperty("oStatus")
    private Integer oStatus; //订单状态
}
